//
//  NSString+Common.h
//  GFrameWork
//
//  Created by qiang on 14-8-21.
//  Copyright (c) 2014年 Gable. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface NSString (Common)

//MD5加密
+(NSString *)MD5:(NSString *)str;
// 是否为空，包含 也为空
+(BOOL) isEmpty:(NSString *) str;

// 根据string返回view需要的相应高度
+(CGFloat)calculateTextHeight:(CGFloat)widthInput Content:(NSString *)strContent  font:(UIFont *)font;

+(CGFloat)calculateTextWidth:(CGFloat)widthInput Content:(NSString *)strContent  font:(UIFont *)font;
+(BOOL)isMobileNumber:(NSString *)mobileNum;
+(BOOL)isValidateEmail:(NSString *)msg;
+(BOOL)istecentqq:(NSString *)qqnum;
+(BOOL)isContainsTelStr:(NSString *)Str;//字符串中是否包含联系方式
+(BOOL)testinputmoney:(UITextField *)textField andrange:(NSRange)range andString:(NSString *)string; //判断输入的金额是否合法
+(NSString *)returnStrFromarray:(NSMutableArray *)arrStrs;
//+(BOOL)lzqstringtest:(NSString *)str andtag:(int)tag;
+(NSString *)cookieValueWithKey:(NSString *)key;
+(BOOL)ispasswd:(NSString *)passwdStr;
+(NSMutableAttributedString *)getAttributedStrFromStr:(NSString *)content andFont:(UIFont *)font andTextColor:(UIColor *)color andRange:(NSRange)range;
+(NSString *)sortRequestData:(NSDictionary *)dic;

+(NSString *)getErrorNSString:(NSString *)status;//根据错误的 状态 描述错误的 原因

+(NSString *)getDitie:(NSString*)str;
+(NSString *)hideTel:(NSString *)str;


/**
 *  字符串MD5加密
 */
- (NSString *)md5Str;
/**
 *  字符串SHA1加密
 */
- (NSString*) sha1Str;
- (NSURL *)urlWithCodePath;
- (CGFloat)getHeightWithFont:(UIFont *)font constrainedToSize:(CGSize)size;
- (CGFloat)getWidthWithFont:(UIFont *)font constrainedToSize:(CGSize)size;
/**
 *  转换拼音
 */
- (NSString *)transformToPinyin;
/**
 *  通过字体获取最合适的大小
 */
- (CGSize)getSizeWithFont:(UIFont *)font constrainedToSize:(CGSize)size;
+ (NSDictionary *)emotion_monkey_dict;
- (NSString *)emotionMonkeyName;
+ (NSString *)sizeDisplayWithByte:(CGFloat)sizeOfByte;
/**
 *  剔除空白区域
 */
- (NSString *)trimWhitespace;
/**
 *  判断字符串是否为空
 */
- (BOOL)isEmpty;

+(CGFloat)getImageBiliFromStr:(NSString *)urlStr;//图片高/宽比例
+(NSString *)getImageUrlFromStr:(NSString *)urlStr;
+(NSString *)getFilePath:(NSString *)FileName;
@end
